package task

import (
	"GoPro/Server/mynet"
)

type CreateRoomRouter struct{}

func (msg *CreateRoomRouter) PreHandler(req mynet.IRequest) bool {
	//_, ok := req.GetServer().OnlineUser[req.]
	//header := msgProto.MsgHeader{}
	//header.MsgType = 400
	//header.MsgSize = 0
	//if !ok {
	//	binary.Write(req.GetIConnection().GetWriter(), binary.BigEndian, header)
	//	return false
	//}
	return true
}

func (msg *CreateRoomRouter) Handler(req mynet.IRequest) bool {

	//exist := req.GetServer().ManagerRoom.FindRoom(req.GetServer().OnlineUser[req.GetIConnection()])
	//if exist != nil {
	//	header := msgProto.MsgHeader{}
	//	header.MsgType = 400
	//	header.MsgSize = 0
	//	binary.Write(req.GetIConnection().GetWriter(), binary.BigEndian, header)
	//	return false
	//}

	//req.GetServer().ManagerRoom.CreateOneRoom(req.GetServer().OnlineUser[req.GetIConnection()])
	return true
}

func (msg *CreateRoomRouter) PostHandler(req mynet.IRequest) bool {
	return true
}
